<template>
  <div class="supervise-list-outer-wrapper"
       :class="{
      'print-supervise': !showPagination
    }">
    <div class="supervise-list-container">
      <StatisticTabsHeader class="statistic-tabs-header"
                           v-model="currentChooseVal"
                           :tabsList="statisticListArr"
                           v-show="statisticListArr.length && isShowStatisticalToolBar"
                           @handleChange="dataTypeChange"></StatisticTabsHeader>
      <div class="pending-list-main"
           v-if="currentChooseVal !== 'workflowBug'"
           :style="{
          top:
            (statisticListArr.length && isShowStatisticalToolBar) || !showPagination ? '44px' : '0'
        }">
        <SpecialSearchCondition v-if="isShowSpecialSearchCondition"
                                :listData="specialSearchConditionList"
                                :selectedValue="specialSearchSelectedValue"
                                @itemClicked="onSpecialSearchConditionClicked"></SpecialSearchCondition>
        <div :id="searchConditionContainerId"></div>
        <div class="pending-list-header">
          <CommonCounter class="common-counter"
                         v-if="selectedRowKeys.length"
                         :total="pagination.total"
                         :currentSelected="selectedRowKeys.length"
                         @cancelSelected="cancelSelected" />
          <div style="flex: 1; overflow: hidden"
               class="common-toolbar">
            <CommonToolbar :allToolBtns="allToolBtns"
                           @buttonClick="buttonClick"></CommonToolbar>
          </div>
          <div class="search-part">
            <a-input-search class="search-input"
                            :placeholder="$i18n('collaboration.new.template.search.keyWords')"
                            style="width: 272px"
                            :allowClear="true"
                            @search="handleSearch"
                            @buttonClick="buttonClick" />
            <div style="margin-left: 12px; display: flex">
              <SearchCondition class="search-condition"
                               :conditions="searchConditions"
                               :containerParentId="searchConditionContainerId"
                               @valueChange="handleSearchConditionChange"
                               @expandChange="expandChange"></SearchCondition>
            </div>
          </div>
        </div>
        <div class="pending-list-content"
             style="flex: 1"
             ref="tableContent">
          <div>
            <AVirtuallyTable ref="avirtuallyTable"
                             :row-selection="{
                columnWidth: 60,
                selectedRowKeys: selectedRowKeys,
                onChange: onSelectChange
              }"
                             rowKey="id"
                             :pagination="showPagination"
                             :paginationOption="pagination"
                             size="small"
                             :columns="columns"
                             :openVirtuallyModel="false"
                             :loading="loading"
                             :dataSource="dataSource"
                             :localstorageKey="getLocalStorageKey"
                             @paginationChange="handleTableChange"
                             @paginationShowSizeChange="paginationShowSizeChange"
                             @updadeStatisticsBar="updadeStatisticsBar">
              <!-- 标题 -->
              <span slot="subject"
                    slot-scope="{ record }">
                <SubjectTableRender :slotData="record"
                                    :datatype="dataType"></SubjectTableRender>
              </span>
              <!-- 当前待办人 -->
              <span slot="currentNodesInfo"
                    slot-scope="{ text, record }">
                <span @click="showFlowChart(record)"
                      class="currentNodesInfo"
                      :title="text">
                  {{ text }}</span>
              </span>
              <!-- 处理期限 -->
              <span slot="processDeadLineName"
                    slot-scope="{ record }">
                <ProcessDeadLineNameTableRender :slotData="record"></ProcessDeadLineNameTableRender>
              </span>
              <!-- 流程期限 -->
              <span slot="deadlineDatetimeName"
                    slot-scope="{ record }">
                <FlowDeadLineNameTableRender :slotData="record"></FlowDeadLineNameTableRender>
              </span>
              <!-- 流程日志 -->
              <span slot="processLog"
                    slot-scope="{ record }">
                <ProcessIdTableRender :dataType="0"
                                      :slotData="record"></ProcessIdTableRender>
              </span>
            </AVirtuallyTable>
          </div>
        </div>
      </div>
      <workflow-bug :dataType="currentChooseVal"
                    :statisRecieveData="statisRecieveData"
                    :needStatisticsVal="needStatisticsVal"
                    @updadeStatisticsBar="updadeStatisticsBar"
                    v-else></workflow-bug>
    </div>
  </div>
</template>

<script>
  import CommonToolbar from '../../components/common-toolbar/index';
  import CommonCounter from '../../components/common-counter/index';
  import SearchCondition from '@/components/search-condition/index.vue';
  import StatisticTabsHeader from '@/components/statistic-tabs-header/index.vue';
  import AVirtuallyTable from '@/ant-virtually-table/table.vue';
  import SubjectTableRender from './components/subject-table-render.vue';
  import ProcessIdTableRender from './components/processId-table-render.vue';
  import ProcessDeadLineNameTableRender from './components/processDeadLineName-table-render.vue';
  import SpecialSearchCondition from '../supervise-mine/components/special-search-condition.vue';

  import FlowDeadLineNameTableRender from './components/flowDeadLineName-table-render.vue';
  import WorkflowBug from '../supervise-mine/src/workflow-bug.vue';

  import { getUrlSearchParams, loadComponentsThemeDefaultCSS } from '../../utils';
  import superviseMixin from '@/mixins/supervise/supervise-mixin.js';
  import { getParams } from '@/utils';
  import { formatRequestDataToJSON, loadExtendResource } from '@/utils/api';
  import * as Fiber from 'fiber';
  export default {
    name: 'superviseAdmin',
    mixins: [superviseMixin],
    components: {
      CommonToolbar,
      CommonCounter,
      SearchCondition,
      AVirtuallyTable,
      StatisticTabsHeader,
      ProcessIdTableRender,
      ProcessDeadLineNameTableRender,
      FlowDeadLineNameTableRender,
      SubjectTableRender,
      WorkflowBug,
      SpecialSearchCondition
    },
    computed: {
      getLocalStorageKey() {
        return window._currentUser.id + 'SUPERVISE_ADMIN';
      }
    },
    data() {
      return {
        showPagination: true,
        affairId: 0,
        urlParamObj: {},
        currentChooseVal: '',
        statisticListArr: [],
        isShowStatisticalToolBar: true, // 是否显示顶部的统计控件
        isShowTotal: true, // 是否显示统计控件的总数
        searchConditionContainerId: 'search-condition-container-parent',
        selectedRowKeys: [],
        selectedRows: [],
        pagination: {
          page: 1,
          total: 0
        },
        showCounter: false,
        allToolBtns: [],
        dataSource: [],
        searchConditions: [],
        columns: [],
        searchValue: '',
        globalParam: {},
        pageHeadItems: [],
        queryCondition: {},
        loading: false,
        needStatisticsVal: false,
        statisRecieveData: null,
        memberIdStr: ''
      };
    },
    created() {
      this.urlParamObj = getUrlSearchParams();
      this.urlParamObj1 = getParams(window.location.search);
      this.memberIdStr = this.urlParamObj1.memberId
        ? decodeURIComponent(this.urlParamObj1.memberId)
        : '';
      this.initPageStatisticData();
      this.loading = true;
      this.initToolbar();
      loadComponentsThemeDefaultCSS(window._ctxPath + window._ctpSkinUrl);
    },
    methods: {
      updadeStatisticsBar(data) {
        if (data) {
          const recieveData = data;
          this.globalParam = recieveData.globalParam || {};
          this.isShowStatisticalToolBar =
            this.globalParam.isShowStatisticalToolBar === '1' ? true : false;
          this.isShowTotal = this.globalParam.isShowTotal == '1' ? true : false;
          const statisticListShowMap = {
            all: this.globalParam.haveAll,
            done: this.globalParam.haveDone,
            overdue: this.globalParam.haveOverdue,
            pending: this.globalParam.havePending,
            workflowBug: this.globalParam.haveProcessException,
            sevenDayOverdue: this.globalParam.haveNoOverdue
          };
          this.showType = this.globalParam.showType;
          const hideValueKeys = ['all'];
          this.statisticListArr = recieveData.pageHead.items.filter((item) => {
            if (!this.isShowTotal) {
              item.hideValue = true;
            } else {
              if (hideValueKeys.includes(item.key)) {
                // 这几种类型不需要显示统计value
                item.hideValue = true;
              } else {
                item.hideValue = false;
              }
            }
            return statisticListShowMap[item.key];
          });
        } else {
          this.initPageStatisticData();
          this.initTableData();
        }
      },
      initToolbar() {
        this.$set(this, 'allToolBtns', []);
        //全部
        if (this.currentChooseVal == 'all') {
          this.allToolBtns.push({
            id: 'editWorkFlow',
            name: this.$i18n('common.design.workflow.label')
          });
          this.allToolBtns.push({
            id: 'batchEditWorkFlow',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify'),
            tip: [
              this.$i18n('workflow.manager.supervise.modify.mag4.js'),
              '1.' + this.$i18n('workflow.manager.supervise.modify.mag5.js'),
              '2.' + this.$i18n('workflow.manager.supervise.modify.mag6.js'),
              '3.' + this.$i18n('workflow.manager.supervise.modify.mag7.js')
            ],
            subMenu: [
              {
                id: 'batchEditWorkFlow_sub',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify')
              },
              {
                id: 'allEditWorkFlow',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.all')
              }
            ]
          });
          this.allToolBtns.push({
            id: 'editWorkFlowLog',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.log')
          });
          this.allToolBtns.push({
            id: 'processEnd',
            name: this.$i18n('supervise.process.End')
          });
          this.allToolBtns.push({
            id: 'processRevoke',
            name: this.$i18n('common.toolbar.repeal.label')
          });
          this.allToolBtns.push({
            id: 'skipNode',
            name: this.$i18n('workflow.manager.skipthisnode.label.js')
          });
          this.allToolBtns.push({
            id: 'stepBackToTargetNode',
            name: this.$i18n('common.workflow.specialback.label')
          });
          this.allToolBtns.push({
            id: 'nodeReplacebatch',
            name: this.$i18n('workflow.manager.nodeReplaceItem.label.js')
          });
          this.allToolBtns.push({
            id: 'urgeDeal',
            name: this.$i18n('common.portal.section.affair.remind.label')
          });
          this.allToolBtns.push({
            id: 'export',
            name: this.$i18n('common.export.label')
          });
          this.allToolBtns.push({
            id: 'print',
            name: this.$i18n('common.toolbar.print.label')
          });
        } else if (this.currentChooseVal == 'pending') {
          //未办结
          this.allToolBtns.push({
            id: 'editWorkFlow',
            name: this.$i18n('common.design.workflow.label')
          });
          this.allToolBtns.push({
            id: 'batchEditWorkFlow',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify'),
            subMenu: [
              {
                id: 'batchEditWorkFlow_sub',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify')
              },
              {
                id: 'allEditWorkFlow',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.all')
              }
            ]
          });
          this.allToolBtns.push({
            id: 'editWorkFlowLog',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.log')
          });
          this.allToolBtns.push({
            id: 'urgeDeal',
            name: this.$i18n('common.portal.section.affair.remind.label')
          });
          this.allToolBtns.push({
            id: 'export',
            name: this.$i18n('common.export.label')
          });
          this.allToolBtns.push({
            id: 'print',
            name: this.$i18n('common.toolbar.print.label')
          });
        } else if (this.currentChooseVal == 'done') {
          //已办结
          this.allToolBtns.push({
            id: 'editWorkFlowLog',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.log')
          });
          this.allToolBtns.push({
            id: 'urgeDeal',
            name: this.$i18n('common.portal.section.affair.remind.label')
          });
          this.allToolBtns.push({
            id: 'export',
            name: this.$i18n('common.export.label')
          });
          this.allToolBtns.push({
            id: 'print',
            name: this.$i18n('common.toolbar.print.label')
          });
          this.allToolBtns.push({
            id: 'deleteSupervise',
            name: this.$i18n('common.toolbar.delete.label')
          });
        } else if (this.currentChooseVal == 'overdue' || this.currentChooseVal == 'sevenDayOverdue') {
          //已超期、七天内超期
          this.allToolBtns.push({
            id: 'editWorkFlow',
            name: this.$i18n('common.design.workflow.label')
          });
          this.allToolBtns.push({
            id: 'batchEditWorkFlow',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify'),
            subMenu: [
              {
                id: 'batchEditWorkFlow_sub',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify')
              },
              {
                id: 'allEditWorkFlow',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.all')
              }
            ]
          });
          this.allToolBtns.push({
            id: 'editWorkFlowLog',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.log')
          });
          this.allToolBtns.push({
            id: 'processEnd',
            name: this.$i18n('supervise.process.End')
          });
          this.allToolBtns.push({
            id: 'processRevoke',
            name: this.$i18n('common.toolbar.repeal.label')
          });
          this.allToolBtns.push({
            id: 'skipNode',
            name: this.$i18n('workflow.manager.skipthisnode.label.js')
          });
          this.allToolBtns.push({
            id: 'stepBackToTargetNode',
            name: this.$i18n('common.workflow.specialback.label')
          });
          this.allToolBtns.push({
            id: 'nodeReplacebatch',
            name: this.$i18n('workflow.manager.nodeReplaceItem.label.js')
          });
          this.allToolBtns.push({
            id: 'urgeDeal',
            name: this.$i18n('common.portal.section.affair.remind.label')
          });
          this.allToolBtns.push({
            id: 'print',
            name: this.$i18n('common.toolbar.print.label')
          });
        } else if (this.currentChooseVal == 'workflowBug') {
          // 流程异常(未处理)
          this.allToolBtns.push({
            id: 'editWorkFlow',
            name: this.$i18n('common.design.workflow.label')
          });
          this.allToolBtns.push({
            id: 'processEnd',
            name: this.$i18n('supervise.process.End')
          });
          this.allToolBtns.push({
            id: 'processRevoke',
            name: this.$i18n('common.toolbar.repeal.label')
          });
          this.allToolBtns.push({
            id: 'dealProblem',
            name: this.$i18n('workflow.bug.set.already.deal.js')
          });
          this.allToolBtns.push({
            id: 'export',
            name: this.$i18n('common.export.label')
          });
          this.allToolBtns.push({
            id: 'print',
            name: this.$i18n('common.toolbar.print.label')
          });
        } else if (this.currentChooseVal == '') {
          this.allToolBtns.push({
            id: 'editWorkFlow',
            name: this.$i18n('common.design.workflow.label')
          });
          this.allToolBtns.push({
            id: 'batchEditWorkFlow',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify'),
            subMenu: [
              {
                id: 'batchEditWorkFlow_sub',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify')
              },
              {
                id: 'allEditWorkFlow',
                name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.all')
              }
            ]
          });
          this.allToolBtns.push({
            id: 'editWorkFlowLog',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.log')
          });
          this.allToolBtns.push({
            id: 'processEnd',
            name: this.$i18n('supervise.process.End')
          });
          this.allToolBtns.push({
            id: 'processRevoke',
            name: this.$i18n('common.toolbar.repeal.label')
          });
          this.allToolBtns.push({
            id: 'skipNode',
            name: this.$i18n('workflow.manager.skipthisnode.label.js')
          });
          this.allToolBtns.push({
            id: 'stepBackToTargetNode',
            name: this.$i18n('common.workflow.specialback.label')
          });
          this.allToolBtns.push({
            id: 'nodeReplacebatch',
            name: this.$i18n('workflow.manager.nodeReplaceItem.label.js')
          });
          this.allToolBtns.push({
            id: 'urgeDeal',
            name: this.$i18n('common.portal.section.affair.remind.label')
          });
          this.allToolBtns.push({
            id: 'export',
            name: this.$i18n('common.export.label')
          });
          this.allToolBtns.push({
            id: 'print',
            name: this.$i18n('common.toolbar.print.label')
          });
        }
      },
      //元数据
      initPageStatisticData() {
        const headerParams = {
          key: 'SUPERVISE',
          platform: 0,
          arguments: {
            memberId: this.memberIdStr,
            managerType: 'formAdmin',
            superviseBoxType: this.currentChooseVal,
            boardId: this.urlParamObj1?.boardId || '',
            needStatisticsVal: this.needStatisticsVal,
            templateIds: this.urlParamObj1.templeteIds || ''
          }
        };
        const url = `${window._ctxPath}/rest/global/metadata/list`;
        window.axios.post(url, headerParams).then((data, err) => {
          const recieveData = data.data.data;
          loadExtendResource(recieveData.extra?.extendResources);
          this.statisRecieveData = recieveData;
          this.globalParam = recieveData.globalParam || {};
          this.isShowStatisticalToolBar =
            this.globalParam.isShowStatisticalToolBar === '1' ? true : false;
          this.isShowTotal = this.globalParam.isShowTotal == '1' ? true : false;

          const statisticListShowMap = {
            all: this.globalParam.haveAll,
            done: this.globalParam.haveDone,
            overdue: this.globalParam.haveOverdue,
            pending: this.globalParam.havePending,
            workflowBug: this.globalParam.haveProcessException,
            sevenDayOverdue: this.globalParam.haveNoOverdue
          };
          this.showType = this.globalParam.showType;
          const hideValueKeys = ['all'];
          this.statisticListArr = recieveData.pageHead.items.filter((item) => {
            if (!this.isShowTotal) {
              item.hideValue = true;
            } else {
              if (hideValueKeys.includes(item.key)) {
                // 这几种类型不需要显示统计value
                item.hideValue = true;
              } else {
                item.hideValue = false;
              }
            }
            return statisticListShowMap[item.key];
          });
          var defaultValue = '';
          for (var item in statisticListShowMap) {
            if (statisticListShowMap[item]) {
              defaultValue = item;
              break;
            }
          }
          const sendParams = [
            {
              condition: '2',
              dataType: this.currentChooseVal || defaultValue,
              flowstate: '0',
              haveOverdue: Boolean(this.globalParam.haveOverdue),
              haveNoOverdue: Boolean(this.globalParam.haveNoOverdue),
              haveProcessException: Boolean(this.globalParam.haveProcessException),
              managerType: 'formAdmin',
              operationType: 'template',
              operationTypeIds: this.urlParamObj1.templeteIds || this.globalParam.templateIds || ''
            }
          ];
          const args = `managerMethod=getProcessSuperviseCountMap&arguments=${JSON.stringify(
            sendParams
          )}`;
          const url = `${window._ctxPath}/ajax.do?method=ajaxAction&managerName=affairManager&rnd=6714`;
          if (this.isShowStatisticalToolBar && this.isShowTotal) {
            window.axios
              .post(url, args, {
                headers: {
                  'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
                }
              })
              .then((data, err) => {
                console.log(err, 'err');
                const result = data.data;
                this.statisticListArr = recieveData.pageHead.items.filter((item) => {
                  if (hideValueKeys.includes(item.key)) {
                    // 这几种类型不需要显示统计value
                    item.hideValue = true;
                  }
                  if (result.hasOwnProperty(item.key)) {
                    item.value = result[item.key];
                  }
                  return statisticListShowMap[item.key];
                });
              });
          }
          this.searchConditions = recieveData.searchConditions.filter(
            (item) => item.key !== 'subject' && item.key !== 'title'
          );
          this.columns = [];
          recieveData.tableColumns.forEach((item) => {
            if (item.type != 'CHECKBOX') {
              this.columns.push({
                title: item.title,
                width: item.width,
                dataIndex: item.key,
                ellipsis: true,
                key: item.key,
                fixed: false,
                dropdownMenus: {
                  asc: true,
                  desc: true,
                  freeze: true,
                  fieldset: true
                },
                scopedSlots: { customRender: item.key },
                customCell: () => {
                  return {
                    style: {
                      cursor: 'pointer'
                    }
                  };
                }
              });
            }
          });
          //分页重置到第一页
          this.pagination.page = 1
          if (!this.currentChooseVal && this.statisticListArr.length) {
            this.currentChooseVal = this.statisticListArr[0].key;
            // this.initPageStatisticData();
            this.initTableData();
            this.initToolbar();
          } else {
            this.initToolbar();
            if (this.currentChooseVal == 'done') {
              this.getDoneTableData();
            }
            if (this.currentChooseVal == 'overdue' || this.currentChooseVal == 'sevenDayOverdue') {
              this.getOverdueData();
            } else if (this.currentChooseVal != 'done' && this.currentChooseVal != 'workflowBug') {
              this.initTableData();
            }
          }
          this.initProcessShowType();
        });
      },
      initTableData() {
        if (this.currentChooseVal == 'overdue' || this.currentChooseVal == 'sevenDayOverdue') {
            this.getOverdueData();
            return;
        }
        this.$refs.avirtuallyTable && this.$refs.avirtuallyTable.cleanSelection();
        let extendParams = {};
        if (this.urlParamObj1.templeteIds) {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.urlParamObj1.templeteIds;
        } else if (this.globalParam.templateIds) {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.globalParam.templateIds;
        }
        let cachParams = {
          subject: this.searchValue,
          condition: '2',
          managerType: 'formAdmin',
          // operationType: 'template',
          dataType: this.currentChooseVal,
          flowstate: '0',
          // sourceType: '0',
          // importantLevel: '',
          // senders: '',
          currentNodesInfo: this.memberIdStr,
          // beginDate: '',
          // endDate: '',
          // deadlineBeginDate: '',
          // deadlineEndDate: '',
          // status: '0',
          // operationTypeIds: '',
          // page: 1,
          ...extendParams,
          ...this.queryCondition,
          ...this.specialSearchConditionParams
        };
        this.cachParams = cachParams;
        const pageInfo = {
          page: this.pagination.page
        };
        if (this.pagination.pageSize) {
          pageInfo.size = this.pagination.pageSize;
        }
        const sendParams = [pageInfo, cachParams];
        const args = `managerMethod=testPaging&arguments=${formatRequestDataToJSON(sendParams)}`;
        const url = `${window._ctxPath}/ajax.do?method=ajaxAction&managerName=workflowManageManager&rnd=6714`;

        if (this.cancelToken && this.cancelToken.cancel) {
          this.cancelToken.cancel();
          this.cancelToken = null;
        }
        this.cancelToken = axios.CancelToken.source();

        window.axios
          .post(url, args, {
            cancelToken: this.cancelToken.token,
            headers: {
              'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
            }
          })
          .then((data, err) => {
            console.log(err, 'err');
            const result = data.data;
            if (result) {
              this.pagination.total = result.total;
              this.dataSource = result.data;
              if (this.statisRecieveData?.pageHead) {
                let curItem = this.statisRecieveData.pageHead.items.find((item) => {
                  return item.key === this.currentChooseVal;
                });
                // curItem && (curItem.value = result.total);
                this.updadeStatisticsBar(this.statisRecieveData);
              }
              if (this.specialSearchConditionParams?.clickedItemId) {
                this.specialSearchConditionList.forEach((item) => {
                  if (this.specialSearchConditionParams.operationTypeIds == item.templateId) {
                    item.values.forEach((val) => {
                      if (val.id == this.specialSearchConditionParams.clickedItemId) {
                        val.name = val.name.replace(/(>\S*<)/, `>${result.total}<`);
                      }
                    });
                  }
                });
              }
              this.loading = false;
            }
          });
      },
      getOverdueData() {
        this.$refs.avirtuallyTable && this.$refs.avirtuallyTable.cleanSelection();
        let extendParams = {};
        if (this.urlParamObj1.templeteIds) {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.urlParamObj1.templeteIds;
        } else {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.globalParam.templateIds;
        }
        const pageInfo = {
          page: this.pagination.page
        };
        if (this.pagination.pageSize) {
          pageInfo.size = this.pagination.pageSize;
        }
        const sendParams = [
          pageInfo,
          {
            condition: '2',
            managerType: 'formAdmin',
            operationType: 'template',
            dataType: this.currentChooseVal,
            flowstate: '0',
            sourceType: '0',
            ...extendParams,
            ...this.queryCondition,
            ...this.specialSearchConditionParams
          }
        ];
        const args = `managerMethod=getSuperviseListForOverDue&arguments=${formatRequestDataToJSON(
          sendParams
        )}`;
        const url = `${window._ctxPath}/ajax.do?method=ajaxAction&managerName=workflowManageManager&rnd=6714`;
        window.axios
          .post(url, args, {
            headers: {
              'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
            }
          })
          .then((data, err) => {
            console.log(err, 'err');
            const result = data.data;
            if (result) {
              this.pagination.total = result.total;
              this.dataSource = result.data;
            }
            this.loading = false
          });
      },
      dataTypeChange(key) {
        this.currentChooseVal = key;
        this.queryCondition = {};
        if (key != 'workflowBug') {
          this.initToolbar();
          this.initPageStatisticData();
        }
        // if (key == 'done') {
        //   this.getDoneTableData();
        // }
        // if (key == 'overdue' || key == 'sevenDayOverdue') {
        //   this.getOverdueData();
        // } else if (key != 'done' && key != 'workflowBug') {
        //   this.initTableData();
        // }
      },
      getDoneTableData(params) {
        this.loading = true;
        this.$refs.avirtuallyTable && this.$refs.avirtuallyTable.cleanSelection();
        let extendParams = {};
        if (this.urlParamObj1.templeteIds) {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.urlParamObj1.templeteIds;
        } else {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.globalParam.templateIds;
        }
        let cachParams = {
          subject: this.searchValue,
          managerType: 'formAdmin',
          // operationType: 'template',
          dataType: this.currentChooseVal,
          flowstate: '0',
          sourceType: '0',
          status: '1',
          ...params,
          ...extendParams,
          ...this.queryCondition
        };
        this.cachParams = cachParams;
        const pageInfo = {
          page: this.pagination.page
        };
        if (this.pagination.pageSize) {
          pageInfo.size = this.pagination.pageSize;
        }
        const sendParams = [pageInfo, cachParams];
        const args = `managerMethod=getAllSuperviseList4Col&arguments=${formatRequestDataToJSON(
          sendParams
        )}`;
        const url = `${window._ctxPath}/ajax.do?method=ajaxAction&managerName=superviseManager`;
        window.axios
          .post(url, args, {
            headers: {
              'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
            }
          })
          .then((data, err) => {
            console.log(err, 'err');
            const result = data.data;
            if (result) {
              this.pagination.total = result.total;
              this.dataSource = result.data;
              this.loading = false;
            }
          });
      },
      cancelSelected() {
        this.showCounter = false;
        // this.selectedRows = [];
        // this.selectedRowKeys = [];
        this.$refs.avirtuallyTable && this.$refs.avirtuallyTable.cleanSelection();
      },
      //按钮点击事件
      buttonClick(buttonKey) {
        let extendParams = {};
        if (this.urlParamObj1.templeteIds) {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.urlParamObj1.templeteIds;
        } else {
          extendParams.operationType = 'template';
          extendParams.operationTypeIds = this.globalParam.templateIds;
        }
        switch (buttonKey) {
          case 'allEditWorkFlow':
            this.batchEditAllFlowChart(
              this.dataSource,
              () => {
                this.initTableData();
                this.$emit('updadeStatisticsBar');
              },
              {
                managerType: this.managerType,
                dataType: this.currentChooseVal,
                searchParams: {
                  subject: this.searchValue,
                  condition: '2',
                  managerType: 'formAdmin',
                  operationType: 'template',
                  dataType: this.currentChooseVal,
                  flowstate: '0',
                  ...extendParams,
                  ...this.queryCondition
                },
                urlParams: this.urlParamObj
              }
            );

            break;
          case 'batchEditWorkFlow_sub':
            this.batchEditFlowChart(
              this.selectedRows,
              () => {
                this.initTableData();
                this.$emit('updadeStatisticsBar');
              },
              {
                managerType: this.managerType,
                dataType: this.currentChooseVal
              }
            );
            break;
          case 'skipNode': //节点跳转
            this.skipNodeFn();
            break;
          case 'stepBackToTargetNode': //指定回退
            this.specifiesReturnFn();
            break;
          case 'nodeReplacebatch': //批量移交
            this.nodeReplaceBatchFn(this.selectedRows);
            break;
          case 'urgeDeal': //催办
            if (this.selectedRowKeys.length > 1) {
              Fiber.message.warning($.i18n('supervise.onlyOne.data.operation'));
            } else if (this.selectedRowKeys.length < 1) {
              Fiber.message.warning($.i18n('supervise.please.select.operation.data'));
            } else {
              this.urgeDealHandler(this.selectedRows[0], this.initTableData);
            }
            break;
          case 'editWorkFlowLog': //修改日志
            this.editWorkFlowLog();
            break;
          case 'deleteSupervise': //删除
            this.deleteSupervise(this.selectedRows, () => {
              this.getDoneTableData();
            });
            break;
          case 'export': //导出
            this.exportExcel(this.cachParams, this.pagination.total, {
              managerType: 'formAdmin',
              dataType: this.currentChooseVal
            });
            break;
          case 'print': //打印
            // this.popprint(this.$refs.tableContent.innerHTML);
            this.showPagination = false;
            this.$nextTick(() => {
              this.popprint(this.$el.outerHTML);
              this.showPagination = true;
            });
            break;
          case 'editWorkFlow': //编辑流程
            if (this.selectedRowKeys.length > 1) {
              Fiber.message.warning($.i18n('supervise.onlyOne.data.operation'));
            } else if (this.selectedRowKeys.length < 1) {
              Fiber.message.warning($.i18n('supervise.please.select.operation.data'));
            } else {
              this.editFlowChart(
                this.selectedRows[0],
                {
                  saveDBOK: {
                    show: true,
                    callback: () => {
                      this.initTableData();
                    }
                  },
                  repeal: {
                    show: true,
                    callback: () => {
                      this.initTableData();
                    }
                  },
                  stop: {
                    show: true,
                    callback: () => {
                      this.initTableData();
                    }
                  },
                  close: {
                    show: true,
                    callback: () => {

                    }
                  }
                },
                { managerType: 'formAdmin', dataType: this.currentChooseVal }
              );
            }
            break;
          case 'processEnd': //流程终止
            if (this.selectedRowKeys.length > 1) {
              Fiber.message.warning($.i18n('supervise.onlyOne.data.operation'));
            } else if (this.selectedRowKeys.length < 1) {
              Fiber.message.warning($.i18n('supervise.please.select.operation.data'));
            } else {
              this.stopFlowChart(
                this.selectedRows[0],
                () => {
                  this.initTableData();
                  this.$emit('updadeStatisticsBar');
                },
                { dataType: this.currentChooseVal }
              );
            }
            break;
          case 'processRevoke': //撤销流程
            if (this.selectedRowKeys.length > 1) {
              Fiber.message.warning($.i18n('supervise.onlyOne.data.operation'));
            } else if (this.selectedRowKeys.length < 1) {
              Fiber.message.warning($.i18n('supervise.please.select.operation.data'));
            } else {
              this.repealflowChart(
                this.selectedRows[0],
                () => {
                  this.initTableData();
                  this.$emit('updadeStatisticsBar');
                },
                { dataType: this.dataType }
              );
            }
            break;
          case 'processRevive': //流程复活
            this.reliveProcess();
            break;
          case 'dealProblem': //标为已处理
            this.dealflowChart(this.selectedRows[0], () => {
              this.initTableData();
              this.$emit('updadeStatisticsBar');
            });
            break;
        }
      },
      //指定回退
      specifiesReturnFn() {
        if (this.selectedRowKeys.length > 1) {
          Fiber.message.warning($.i18n('supervise.onlyOne.data.operation'));
          return;
        } else if (this.selectedRowKeys.length < 1) {
          Fiber.message.warning($.i18n('supervise.please.select.operation.data'));
          return;
        }
        var selectRow = this.selectedRows[0];
        if (selectRow.endFlag == '0') {
          Fiber.message.warning($.i18n('collaboration.worklfow.state.error.msg.js'));
          return;
        }
        this.selectStepBackNode(selectRow);
      },

      //批量移交
      nodeReplaceBatchFn() {
        var selectRow = this.selectedRows;
        if (selectRow.length === 0) {
          Fiber.message.warning($.i18n('supervise.please.select.operation.data')); //请选择要操作的数据！
          return;
        }
        var selectObjectIds = new Array();
        var hasFinishProcess = false;
        for (var i = 0; i < selectRow.length; i++) {
          selectObjectIds.push(selectRow[i].summaryId);
          if (selectRow[i].endFlag == '0') {
            hasFinishProcess = true;
          }
        }
        if (hasFinishProcess) {
          Fiber.message.warning($.i18n('workflow.manager.hasProcessFinish.js'));
          return;
        }
        this.nodeReplaceBatch(selectRow, '', '', '', selectObjectIds, '2', '');
      },
      nodeReplaceBatch(
        data,
        dialog,
        currentNodeInfoValue,
        currentNodeInfoText,
        selectObjectIds,
        app,
        isAvailablePeople
      ) {
        if (this.checkBatchSizeForToolBar()) {
          var _that = this;
          var replaceCurrentDialog = $.dialog({
            targetWindow: window.getCtpTop(),
            id: 'replaceCurrentDialog',
            bottomHTML: '',
            url:
              window._ctxPath + '/workflowmanage/workflowmanage.do?method=replaceCurrentUserDialog',
            width: 380,
            height: 120,
            title: $.i18n('workflow.manager.nodeReplaceItem.label.js'), //系统提示
            transParams: {
              currentNodeInfoValue: currentNodeInfoValue,
              currentNodeInfoText: currentNodeInfoText,
              objectId: selectObjectIds.join(','),
              app: app,
              isAvailablePeople: isAvailablePeople
            },
            closeParam: {
              show: true,
              autoClose: true,
              handler: function () {
                replaceCurrentDialog.close();
              }
            },
            buttons: [
              {
                text: $.i18n('common.button.ok.label'), //确定
                handler: function () {
                  var rvv = replaceCurrentDialog.getReturnValue();
                  if (rvv) {
                    //再次确认是否替换
                    var confirmDialog = $.confirm({
                      msg: $.i18n('workflow.manager.nodeReplaceItem.confirm.js'),
                      ok_fn: function () {
                        var tempMap = new Object();
                        tempMap['oldMemberId'] = rvv['oldMemberValue'];
                        tempMap['newMemberId'] = rvv['newMemberValue'];
                        tempMap['pending'] = rvv['pending'];
                        tempMap['allocation'] = rvv['allocation'];
                        tempMap['app'] = app;
                        tempMap['objectId'] = selectObjectIds.join(',');
                        window.callBackendMethod('workflowManageManager', 'replaceNode', tempMap, {
                          success: function (msg) {
                            if (msg != null && msg != '') {
                              //Fiber.message.warning(msg);
                              // 成功删除，并刷新列表
                              $.messageBox({
                                title: $.i18n('common.system.hint.label'),
                                type: 0,
                                msg: msg,
                                imgType: 0,
                                ok_fn: function () {
                                  replaceCurrentDialog.close();
                                  _that.initTableData();
                                  _that.$emit('updadeStatisticsBar');
                                },
                                close_fn: function () {
                                  replaceCurrentDialog.close();
                                  _that.initTableData();
                                  _that.$emit('updadeStatisticsBar');
                                }
                              });
                            }
                          },
                          error: function (msg) {
                            Fiber.message.warning(msg);
                          }
                        });
                        confirmDialog.close();
                        replaceCurrentDialog.close();
                      }
                    });
                  }
                }
              },
              {
                text: $.i18n('common.button.cancel.label'), //取消
                handler: function () {
                  replaceCurrentDialog.close();
                }
              }
            ]
          });
        }
      },
      //非批量操作校验
      checkSizeForToolBar() {
        var selectRows = this.selectedRowKeys;
        if (selectRows.length === 0) {
          Fiber.message.warning($.i18n('supervise.please.select.operation.data')); //请选择要操作的数据！
          return false;
        } else if (selectRows.length > 1) {
          Fiber.message.warning($.i18n('supervise.onlyOne.data.operation')); //只能选择一条数据进行操作！
          return false;
        }
        return true;
      },
      //批量操作的判断
      checkBatchSizeForToolBar() {
        var selectRows = this.selectedRowKeys;
        if (selectRows.length === 0) {
          Fiber.message.warning($.i18n('supervise.please.select.operation.data')); //请选择要操作的数据！
          return false;
        }
        return true;
      },
      handleSearch(val) {
        this.specialSearchSelectedValue = '';
        this.specialSearchConditionParams = null;
        this.queryCondition.subject = val;
        this.searchValue = val;
        this.pagination.page = 1;
        if (this.currentChooseVal == 'overdue' || this.currentChooseVal == 'sevenDayOverdue') {
          this.getOverdueData();
        } else {
          this.initTableData();
        }
      },
      handleSearchConditionChange(condition) {
        this.specialSearchSelectedValue = '';
        this.specialSearchConditionParams = null;
        if (
          (condition.flowstate == '3' || condition.flowstate == '1') &&
          this.currentChooseVal == 'all'
        ) {
          this.$set(this, 'allToolBtns', []);
          this.allToolBtns.push({
            id: 'editWorkFlow',
            name: this.$i18n('common.design.workflow.label')
          });
          this.allToolBtns.push({
            id: 'editWorkFlowLog',
            name: this.$i18n('collaboration.common.workflow.supervise.batch.modify.log')
          });
          this.allToolBtns.push({
            id: 'processEnd',
            name: this.$i18n('supervise.process.End')
          });
          this.allToolBtns.push({
            id: 'processRevoke',
            name: this.$i18n('common.toolbar.repeal.label')
          });
          this.allToolBtns.push({
            id: 'processRevive',
            name: this.$i18n('supervise.process.revive')
          });
          this.allToolBtns.push({
            id: 'urgeDeal',
            name: this.$i18n('common.portal.section.affair.remind.label')
          });
          this.allToolBtns.push({
            id: 'export',
            name: this.$i18n('common.export.label')
          });
          this.allToolBtns.push({
            id: 'print',
            name: this.$i18n('common.toolbar.print.label')
          });
        } else if (this.currentChooseVal == 'all' && condition.flowstate == '0') {
          this.initToolbar();
        }
        this.pagination.page = 1;
        //重要程度，状态
        const enumKeys = ['importLevel', 'importantLevelList', 'subState'];
        Object.keys(condition).forEach((key) => {
          if (enumKeys.includes(key)) {
            condition[key] = condition[key].join(',');
          }
        });
        //发起时间
        if (condition.createDate) {
          condition.beginDate = condition.createDate.startDate;
          condition.endDate = condition.createDate.endDate;
        }
        //当前待办人
        if (condition.currentNodesInfoStr) {
          condition.currentNodesInfo = condition.currentNodesInfoStr.value;
          delete condition.currentNodesInfoStr;
        }
        //发起对象
        if (condition.startMemberName) {
          // condition.startMemberName = condition.startMemberName.value;
          condition.senders = condition.startMemberName.value;
          delete condition.startMemberName;
        }
        //模版流程
        if (condition.processTemplateName) {
          condition.operationTypeIds = condition.processTemplateName.value;
        }
        this.queryCondition = condition;
        if (this.currentChooseVal == 'overdue' || this.currentChooseVal == 'sevenDayOverdue') {
          this.getOverdueData();
        } else {
          this.initTableData();
        }
      },
      onSelectChange(selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys;
        this.selectedRows = selectedRows;
      },
      // onSelectRecord(record, selected, selectedRows) {
      //   this.selectedRows = selectedRows;
      // },
      handleTableChange(page, pageSize) {
        this.pagination.page = page;
        this.pagination.pageSize = pageSize;
        this.initTableData();
      },
      paginationShowSizeChange(current, size) {
        this.pagination.page = 1;
        this.pagination.pageSize = size;
        this.initTableData();
      },
      rowClick(record) {
        console.log(record);
      },
      handleExpand(val) {
        this.isShowHeight = val;
      },
      selectStepBackNode(param, dialog) {
        var idMap = {
          processId: param.processId,
          caseId: param.caseId,
          summaryId: param.summaryId
        };
        console.log('$.ctp.trigger', 'beforeDealspecifiesReturn', idMap);
        const sendDevelop = $.ctp.trigger('beforeDealspecifiesReturn', idMap);
        if (!sendDevelop) {
          return;
        }
        var summaryId = param.summaryId;
        var _that = this;
        window.callBackendMethod('workflowManageManager', 'getActivitNodeInfo', summaryId, {
          success: function (nodeInfos) {
            //当前待办节点超期一个节点时弹出页面选择回退节点
            if (nodeInfos && nodeInfos.length > 1) {
              var selectStepBackNodeDialog = $.dialog({
                id: 'dialog_selectStepBackNode',
                url:
                  window._ctxPath +
                  '/workflowmanage/workflowmanage.do?method=stepBackSelectNodeDialog&summaryId=' +
                  summaryId,
                width: 400,
                height: 300,
                title: $.i18n('collaboration.appointStepBack.selectStepBackNode.js'),
                targetWindow: window.getCtpTop(),
                transParams: {
                  nodeInfos: nodeInfos
                },
                buttons: [
                  {
                    text: $.i18n('common.button.ok.label'),
                    isEmphasize: true,
                    handler: function () {
                      var stepBackNodeMessage = selectStepBackNodeDialog.getReturnValue({
                        innerButtonId: 'ok'
                      });
                      if (stepBackNodeMessage) {
                        selectStepBackNodeDialog.close();
                        var data = $.extend(param, stepBackNodeMessage);
                        _that.stepBackToTargetNodeFn(data, dialog);
                      }
                    }
                  },
                  {
                    text: $.i18n('common.button.cancel.label'),
                    handler: function () {
                      selectStepBackNodeDialog.close();
                    }
                  }
                ]
              });
              //待办节点只有一个时直接提交
            } else if (nodeInfos && nodeInfos.length == 1) {
              param.workitemId = nodeInfos[0].workitemId;
              param.activityId = nodeInfos[0].id;
              _that.stepBackToTargetNodeFn(param, dialog);
            } else {
              $.alert($.i18n('supervise.no.data.operation.js'));
              // _that.$message.warning($.i18n('supervise.no.data.operation.js'));
            }
          },
          error: function (msg) {
            _that.$message.warning(msg);
          }
        });
      },
      stepBackToTargetNodeFn(data) {
        var caseId = data.caseId;
        var processId = data.processId;
        // var summaryId = data.summaryId;
        var workitemId = data.workitemId;
        var isTemplate = data.isTemplate;
        var activityId = data.activityId;
        if (typeof isTemplate == 'undefined') {
          isTemplate = data.isFromTemplete;
        }
        var appName = data.appName;
        if (typeof appName == 'undefined') {
          appName = data.appEnumStr;
        }
        var subState = data.subState;
        if (subState == '15' || subState == '17') {
          Fiber.message.warning($.i18n('collaboration.alert.CantModifyBecauseOfAppointStepBack'));
          return true;
        }

        var stepBakParams = {};
        stepBakParams.tWindow = window.getCtpTop();
        stepBakParams.vWindow = window.getCtpTop();
        stepBakParams.workitemId = workitemId;
        stepBakParams.processId = processId;
        stepBakParams.caseId = caseId;
        stepBakParams.activityId = activityId;
        stepBakParams.stepBackToTargetNodeCallBackFn = this.selectMemberId4BackToMe;
        stepBakParams.showReGo = true;
        stepBakParams.showToMe = true;
        stepBakParams.permissionAccountId = '';
        stepBakParams.appName = appName;
        stepBakParams.NPS = 'default';
        stepBakParams.isTemplate = false;
        stepBakParams.wfTraceType = '';
        stepBakParams.isShowwfTraceButton = true;

        window.stepBackToTargetNode(stepBakParams);
      },
      selectMemberId4BackToMe(
        workitemId,
        processId,
        caseId,
        activityId,
        theStepBackNodeId,
        submitStyle,
        falshDialog,
        stepBackTargetNodeName,
        isTraceInt
      ) {
        if (theStepBackNodeId == 'start' && this.isTriggerReceiveFlow(processId)) {
          $.alert('触发产生的收文，暂不支持回退发起人。');
          return;
        }
        var _that = this;
        var wmManager = new workflowManageManager();
        wmManager.getMemberInfoByObjectIdAndNodeId(processId, activityId, {
          success: function (memberInfos) {
            //节点中的人员超过1个，并且选择的是提交给我弹出选人页面选择回退人
            if (memberInfos && memberInfos.length > 1 && submitStyle == '1') {
              var selectMemberId4BackToMeDialog = $.dialog({
                id: 'dialog_selectMemberId4BackToMe',
                url:
                  _ctxPath +
                  '/workflowmanage/workflowmanage.do?method=stepBackSelectMemberDialog&processId=' +
                  processId +
                  '&activityId=' +
                  activityId,
                width: 400,
                height: 300,
                title: $.i18n('collaboration.appointStepBack.selectStepBackMember.js'),
                targetWindow: getCtpTop(),
                transParams: {
                  memberInfos: memberInfos
                },
                buttons: [
                  {
                    text: $.i18n('common.button.ok.label'),
                    isEmphasize: true,
                    handler: function () {
                      var newWorkitemId = selectMemberId4BackToMeDialog.getReturnValue({
                        innerButtonId: 'ok'
                      });
                      if (_that.stepBackToTargetNodeCallBack) {
                        selectMemberId4BackToMeDialog.close();
                        _that.stepBackToTargetNodeCallBack(
                          newWorkitemId,
                          processId,
                          caseId,
                          activityId,
                          theStepBackNodeId,
                          submitStyle,
                          falshDialog,
                          stepBackTargetNodeName,
                          isTraceInt
                        );
                      }
                    }
                  },
                  {
                    text: $.i18n('common.button.cancel.label'),
                    handler: function () {
                      selectMemberId4BackToMeDialog.close();
                    }
                  }
                ]
              });
              //只有一个人时直接提交
            } else if ((memberInfos && memberInfos.length == 1) || submitStyle == '0') {
              _that.stepBackToTargetNodeCallBack(
                workitemId,
                processId,
                caseId,
                activityId,
                theStepBackNodeId,
                submitStyle,
                falshDialog,
                stepBackTargetNodeName,
                isTraceInt
              );
            } else {
              $.alert($.i18n('supervise.no.data.operation.js'));
            }
          },
          error: function (msg) {
            _that.releaseWorkflowByAction(processId, _wfcurrentUserId, 11);
            $.alert(msg);
          }
        });
      },
      isTriggerReceiveFlow(summaryId) {
        if ($.ctx.hasPlugin('edoc')) {
          return window.callBackendMethod('workflowManageManager', 'isTriggerReceiveFlow', summaryId);
        }
        return false;
      },
      stepBackToTargetNodeCallBack(
        workitemId,
        processId,
        caseId,
        activityId,
        theStepBackNodeId,
        submitStyle,
        falshDialog
        // stepBackTargetNodeName,
        // isTraceInt
      ) {
        var tempMap = new Object();
        tempMap['workitemId'] = workitemId;
        tempMap['theStepBackNodeId'] = theStepBackNodeId;
        tempMap['submitStyle'] = submitStyle;
        var _that = this;
        callBackendMethod('workflowManageManager', 'updateAppointStepBack', tempMap, {
          success: function (msg) {
            if (msg == null || msg == '') {
              _that.initTableData();
              falshDialog.close();
            } else {
              this.releaseWorkflowByAction(processId, window._wfcurrentUserId, 11);
              try {
                var msgObject = $.parseJSON(msg);
                if (msgObject.alertMessage) {
                  Fiber.message.warning(msgObject.alertMessage);
                } else {
                  Fiber.message.warning(msg);
                }
              } catch (e) {
                Fiber.message.warning(msg);
              }
            }
          },
          error: function (msg) {
            this.releaseWorkflowByAction(processId, window._wfcurrentUserId, 11);
            Fiber.message.warning(msg);
          }
        });
      },
      releaseWorkflowByAction(processId, currentUserId, action) {
        try {
          // return wfAjax.releaseWorkflow(processId, currentUserId, action);
          const sendParams = [
            {
              processId,
              currentUserId,
              action
            }
          ];
          const args = `managerMethod=releaseWorkflow&arguments=${formatRequestDataToJSON(
            sendParams
          )}`;
          const url = `${window._ctxPath}/ajax.do?method=ajaxAction&managerName=WFAjax&rnd=6714`;
          window.axios
            .post(url, args, {
              headers: {
                'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
              }
            })
            .then((data, err) => {
              console.log(err, data);
            });
        } catch (e) {
          alert(e.message);
        }
      },
      skipNodeFn() {
        this.checkBatchSizeForToolBar();
        if (this.selectedRowKeys.length > 1) {
          Fiber.message.warning($.i18n('supervise.onlyOne.data.operation'));
          return;
        }
        var selectRow = this.selectedRows[0];
        if (selectRow.bodyType == '20') {
          selectRow.spk = 'collaboration_template_form';
          selectRow.nps = 'form';
        }
        selectRow.isSkipNode = 'true';
        selectRow.callBackFn = this.initTableData;
        this.editFlowChartFn(selectRow);
        selectRow.isSkipNode = 'false';
      },
      expandChange(isExpanded) {
        this.$nextTick(() => {
          this.$refs.avirtuallyTable && this.$refs.avirtuallyTable.resizeTable();
        });
        console.log(this.$refs.avirtuallyTable.resize);
        console.log(isExpanded, 'isExpanded');
      },
      //流程复活
      reliveProcess() {
        this.checkSizeForToolBar();
        var selectRow = this.selectedRows[0];
        var dataFrom = selectRow.dataFrom;
        var app = selectRow.appEnum;
        // 公文数据来源于其他系统不支持流程复活
        if (dataFrom && dataFrom > 0 && app === '4') {
          alert($.i18n('edoc.workflow.relive.check.dataFrom'));
          return;
        }
        var caseId = selectRow.caseId;
        var processId = selectRow.processId;
        var summaryId = selectRow.summaryId;
        var tempMap = new Object();
        tempMap['caseId'] = caseId;
        tempMap['processId'] = processId;
        tempMap['summaryId'] = summaryId;
        if (app == '1') {
          tempMap['appName'] = 'collaboration';
        } else if (app == '2') {
          tempMap['appName'] = 'form';
        } else {
          tempMap['appName'] = 'edoc';
        }
        var _that = this;
        callBackendMethod('workflowManageManager', 'beforeReliveProcess', tempMap, {
          success: function (ret) {
            var validateResult = $.parseJSON(ret);
            if (validateResult.success == 'true') {
              var confirm = $.confirm({
                msg: validateResult.validateResult,
                ok_fn: function () {
                  callBackendMethod('workflowManageManager', 'reliveProcess', tempMap, {
                    success: function (msg) {
                      var result = JSON.parse(msg);
                      if (result.success == 'true') {
                        $.infor(result.validateResult);
                      } else {
                        $.alert(result.validateResult);
                      }
                      _that.initTableData();
                    }
                  });
                },
                cancel_fn: function () {},
                close_fn: function () {}
              });
            } else {
              $.alert(validateResult.validateResult);
            }
          },
          error: function (request, settings, e) {
            console.log(request);
            $.alert(e);
          }
        });
      }
    }
  };
</script>
<style>
  @import url('../../assets/css/common.css');
</style>
<style lang="scss">
  .supervise-list-outer-wrapper {
    height: 100%;
  }
  .currentNodesInfo {
    color: #2490f8;
    color: var(--theme-brand5, #2490f8);
  }
  .search-condition-container {
    margin-left: 16px;
  }
  .supervise-list-container {
    text-align: center;
    color: #2c3e50;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;

    .pending-list-main {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      top: 85px;
      display: flex;
      flex-direction: column;
      background-color: #ffffff;
      .pending-list-header {
        display: flex;
        padding: 12px 16px 12px 16px;
        height: 54px;
        box-sizing: border-box;
      }

      .search-part {
        display: flex;
        justify-content: flex-end;
        overflow: hidden;
        margin-left: 100px;
      }

      .pending-list-content {
        position: relative;
        overflow: hidden;
        flex: 1;
        padding: 0 10px 0 16px;

        > div {
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
        }
      }
      .tag-show {
        border-radius: 2px;
        border: none;
      }
    }
  }
  .print-supervise {
    .pending-list-main {
      position: relative;
      top: 0px !important;
    }
    .statistic-tabs-header {
      display: none;
    }
    .supervise-list-container .pending-list-main .pending-list-header {
      display: none;
    }
    .common-counter {
      display: none;
    }
    .common-toolbar {
      display: none;
    }
    .search-part {
      display: none;
    }
    .search-input {
      display: none;
    }
    .search-condition {
      display: none;
    }
    .search-condition-container {
      display: none;
    }
    .ant-table-body {
      height: auto !important;
      max-height: none !important;
    }
    .scrollbar {
      display: none;
    }
    .supervise-list-container .pending-list-main .pending-list-content > div {
      position: relative;
    }
  }

  #context.content.set_ul_ls {
    // 打印的时候需要用到，解决多出一页空白的问题
    border: 1px solid white;
  }
</style>
